<template>
	<view class="">
		<view class="" style="margin: 30rpx;color: #9c9c9c;display: flex; align-items: center;justify-content: space-around;">
			<text>患者姓名：{{title.xm}}</text> 
			<text>性别：{{title.xb}}</text>
			<text>年龄：{{title.nl}} 岁</text>
		</view>
		<view v-for="(item,index) in list2">
			<uni-card :title="'处置医生：'+item.ysname" :thumbnail="avatar" @click="onClick">
				<text class="uni-body">
					记录时间：{{item.sj}}
					\n诊断：{{item.zd}}
					\n备注：{{item.bz}}
				</text>
			</uni-card>
		</view>
	</view>
</template>

<script>
	import { illnessById } from '../../api/huanzhe.js'
	export default {
		data() {
			return {
				active: -1,
				list2: [],
				title:{
					xm:null,
					xb:null,
					nl:null
				}
			};
		},
		onLoad(option){
			var query=JSON.parse(option.data)
			this.title.xm=query.xm
			this.title.xb=query.xb
			this.title.nl=query.nl
			this.illnessByIds(query.id)
		},
		methods:{
			// 根据患者id查询
			illnessByIds(hzId){
				illnessById(hzId).then(res=>{
					console.log(res);
					this.list2=res.rows
				})
			}
		}
	}
</script>

<style lang="scss">

</style>